<template>
  <div>
    <div class="header">
      <div class="box" v-for="item in headerData" :key="item.id">
        <div class="text">{{ item.title }}</div>
        <div class="num">{{ item.unit }}{{ item.value }}</div>
      </div>
    </div>
    <div class="chartBox">
      <div v-for="(item, index) in foldLineStat" :key="index">
        <div>{{ item.title }}</div>
        <k-button class="top-btn" value="本月" @click.native="clickMonth" />
        <k-button
          class="top-btn"
          value="近六个月"
          @click.native="clickSixMonths"
        />
        <span class="filter-title filter-item">日期时间</span>
        <k-date-picker
          v-model="timeValue"
          class="filter-item right-item"
          @hqchang="$refs.hqSearchDown.searchFun()"
        />
        <div :id="item.chart"></div>
      </div>
    </div>
    <pieChart></pieChart>
  </div>
</template>
<script>
import pieChart from "./pieChart";
export default {
  components: { pieChart },
  data() {
    return {
      headerData: [
        {
          id: 1,
          title: "今日消费余额",
          unit: "$",
          value: "11111",
        },
        {
          id: 2,
          title: "今日消费活跃地",
          value: "11111",
        },
        {
          id: 3,
          title: "本月消费金额",
          unit: "$",
          value: "11111",
        },
        {
          id: 4,
          title: "本月消费活跃地",
          value: "11111",
        },
      ],
      foldLineStat: [
        {
          title: "消费金额统计",
          type: "金额",
          chart:'amountStat'
        },
        {
          title: "消费时间段统计",
          type: "数量",
          chart:'numberStat'
        },
      ],
    };
  },
  mounted() {},
  methods: {},
};
</script>

<style scoped lang="scss">
.header {
  margin: 30px 200px;
  display: flex;
  justify-content: space-between;
  .box {
    background: #eee;
    width: 250px;
    height: 150px;
    .text {
      margin: 20px;
    }
    .num {
      text-align: center;
    }
  }
}
.chartBox {
    display: flex;
}
</style>